package com.shaokel.service.impl;

import com.shaokel.pojo.User;
import com.shaokel.repository.UserRepository;
import com.shaokel.service.UserService;
import com.shaokel.config.utils.MD5Utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 少丶客
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Date 2020/6/24 11:22
 * @Vesion 1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    //登录功能
    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }
}